onEventFlow
Extension function to listen for a specific socket event and emit its data as a flow.
Return
A flow that emits the processed event data.
Example usage:
val messageFlow = socket.onEventFlow(SocketEvents.ON_MESSAGE) { it.toString() }
Content copied to clipboard
Parameters
T
The type of data to emit.
socket
The Socket instance to listen to.
evaluation
A function to process the received event data.